#include <iostream>
#include <thread>
#include <vector>
#include <chrono>
using namespace std;

void thread_function(int id)
{
    cout << "Thread " << id << " is running ---->start" << endl;
    this_thread::sleep_for(chrono::milliseconds(id*1000));
    cout << "Thread " << id << " is running ---->end" << endl;
}

int main()
{
    std::vector<std::thread> threads;
    threads.emplace_back(thread_function, 1);
    threads.emplace_back(thread_function, 2);

    for (auto &t : threads)
    {
        t.join();
    }

    return 0;
}